home *** CD-ROM | disk | FTP | other *** search
- /*--------------------------------------------------------------------------*/
- /*------------------- phinter PHIGS PLUS functions -------------------------*/
- /*--------------------------------------------------------------------------*/
-
- static void do_pcellarray3plus()
- {
- #ifdef SUN
- Pparal paral;
- Pint_size dim;
- Pint colour_model, i;
- Pcoval *colrs;
-
- paral.p = readpoint3("parallelogram, point p");
- paral.q = readpoint3("parallelogram, point q");
- paral.r = readpoint3("parallelogram, point r");
- dim.size_x = readinteger("number of cell divisions, x ? ");
- dim.size_y = readinteger("number of cell divisions, y ? ");
- colour_model = readinteger("colour model ? ");
- colrs = (Pcoval *)calloc(dim.size_x * dim.size_y, sizeof(Pcoval));
- readcovalarray(colour_model, dim.size_x * dim.size_y, colrs);
- pcell_array3_plus(¶l, &dim, colour_model, colrs);
- free(colrs);
- #endif
- } /* do_pcellarray3plus */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pcompfillareasetgnorm()
- {
- #ifdef SUN
- Pint vflag, nfa, err, i;
- Pfacet_vdata_list3 *vdata;
- Pvec3 normal;
-
- vflag = readinteger("vertex data flag ? ");
- nfa = readinteger("number of fill areas ? ");
- readfacetvdatalist3(vflag, colourmodel, nfa, vdata);
- pcomp_fill_area_set_gnorm(vflag, nfa, vdata, &err, &normal);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- phinprintf(PTKEINFORM, "geometric normal:\n");
- writevector3(PTKEINFORM, &normal);
- }
- else
- phigserror(PTKEINFORM, err);
- }
- for (i = 0; i < nfa; i++)
- free(vdata[i].vertex_data);
- free(vdata);
- #endif
- } /* do_pcompfillareasetgnorm */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pfillareasetdata()
- {
- #ifdef SUN
- phintererror(1, (char *)NULL, INFORM);
- #endif
- } /* do_pfillareasetdata */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pfillareaset3data()
- {
- #ifdef SUN
- Pint fflag, eflag, vflag, colour_model, nfa, i;
- Pfacet_data3 fdata;
- Pedge_data_list *edata;
- Pfacet_vdata_list3 *vdata;
-
- fflag = readinteger("facet data flag ? ");
- eflag = readinteger("edge data flag ? ");
- vflag = readinteger("vertex data flag ? ");
- colour_model = readinteger("colour model ? ");
- readfacetdata3(fflag, colour_model, &fdata);
- nfa = readinteger("number of fill areas ? ");
- if (eflag == PEDGE_VISIBILITY)
- readedgedatalist(eflag, nfa, edata);
- vdata = (Pfacet_vdata_list3 *)calloc(nfa, sizeof(Pfacet_vdata_list3));
- for (i = 0; i < nfa; i++)
- readfacetvdatalist3(vflag, colour_model, i, &vdata[i]);
- pfill_area_set3_data(fflag, eflag, vflag, colour_model,
- &fdata, nfa, edata, vdata);
- for (i = 0; i < nfa; i++)
- {
- switch (vflag)
- {
- case PVERT_COORD:
- free(vdata[i].vertex_data.points);
- break;
-
- case PVERT_COORD_COLOUR:
- free(vdata[i].vertex_data.ptcolrs);
- break;
-
- case PVERT_COORD_NORMAL:
- free(vdata[i].vertex_data.ptnorms);
- break;
-
- case PVERT_COORD_COLOUR_NORMAL:
- free(vdata[i].vertex_data.ptconorms);
- break;
- }
- if (eflag == PEDGE_VISIBILITY)
- free(edata[i].edgedata.edges);
- }
- free(vdata);
- free(edata);
- #endif
- } /* do_pfillareaset3data */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqcolrmapfacs()
- {
- #ifdef SUN
- Pint type, length, start, err, totlen;
- Pcolr_map_facs facs;
-
- readwstype(&type);
- start = readinteger("starting position in list ? ");
- pinq_colr_map_facs(type, 0, start, &err, &facs, &totlen);
- facs.meths.ints = (Pint *)calloc(totlen, sizeof(Pint));
- pinq_colr_map_facs(type, totlen, start, &err, &facs, &totlen);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- phinprintf(PTKEINFORM, "available colour mapping methods:\n");
- phinprintf(PTKEINFORM, "number = ");
- writeintlst(PTKEINFORM, &facs.meths, PTKENOTABLE);
- phinprintf("number of predefined indicies = %d\n", facs.num_pred_inds);
- }
- else
- phigserror(PTKEINFORM, err);
- }
- free(facs.meths.ints);
- #endif
- } /* do_pinqcolrmapfacs */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqcolrmapmethodfacs()
- {
- #ifdef SUN
- Pint type, map_method, err;
- Pcolr_map_st map_st;
-
- readwstype(&type);
- map_method = readinteger("mapping method ? ");
- pinq_colr_map_method_facs(type, map_method, &err, &map_st);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- phinprintf(PTKEINFORM, "colour mapping method facilities:\n");
- switch (map_method)
- {
- case PCOLR_MAP_TRUE:
- phinprintf(PTKEINFORM, "number of available true colours = %d\n",
- map_st.int_data);
- break;
-
- case PCOLR_MAP_PSEUDO:
- phinprintf(PTKEINFORM, "number of available pseudo colours = %d\n",
- map_st.int_data);
- break;
-
- case PCOLR_MAP_PSEUDO_N:
- break;
- }
- }
- else
- phigserror(PTKEINFORM, err);
- }
- #endif
- } /* do_pinqcolrmapmethodfacs */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqcolrmaprep()
- {
- #ifdef SUN
- Pint ws, index, err, map_method, i;
- Pinq_type type;
- Pstore store;
- Pcolr_map_data *map_data;
-
- ws = readinteger("workstation identifier ? ");
- index = readinteger("colour mapping index ? ");
- type = readphigsenum(PTKEINQTYPE, "inquire type ? ");
- pcreate_store(&err, &store);
- pinq_colr_map_rep(ws, index, type, store, &err, &map_method,
- &map_data);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- phinprintf(PTKEINFORM, "colour mapping method = %d\n", map_method);
- switch (map_method)
- {
- case PCOLR_MAP_TRUE:
- break;
-
- case PCOLR_MAP_PSEUDO:
- phinprintf(PTKEINFORM, "colour model = %d\n",
- map_data->meth_r2.colr_model);
- phinprintf(PTKEINFORM, "weights:\n");
- phinprintf(PTKEINFORM, "number = ");
- writefloatlist(PTKEINFORM, &map_data->meth_r2.weights);
- writecolreplist(PTKEINFORM, map_data->meth_r2.colr_model,
- &map_data->meth_r2.colrs);
- break;
-
- case PCOLR_MAP_PSEUDO_N:
- phinprintf(PTKEINFORM, "colour model = %d\n",
- map_data->meth_r3.colr_model);
- phinprintf(PTKEINFORM, "direct colours:\n");
- phinprintf(PTKEINFORM, "number = ");
- writeinteger(PTKEINFORM, map_data->meth_r3.colr_lists.num_lists);
- for (i = 0; i < map_data->meth_r3.colr_lists.num_lists; i++)
- writefloatlist(PTKEINFORM,
- &map_data->meth_r3.colr_lists.lists[i]);
- break;
-
- }
- }
- else
- phigserror(PTKEINFORM, err);
- }
- pdel_store(store);
- #endif
- } /* do_pinqcolrmaprep */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqcolrmapst()
- {
- #ifdef SUN
- Pint ws, map_method, err;
- Pcolr_map_st map_st;
-
- ws = readinteger("workstation identifier ? ");
- map_method = readinteger("colour mapping method ? ");
- pinq_colr_map_st(ws, map_method, &err, &map_st);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- phinprintf(PTKEINFORM, "colour mapping state = %d\n",
- map_st.int_data);
- }
- else
- phigserror(PTKEINFORM, err);
- }
- #endif
- } /* do_pinqcolrmapst */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqcurvsurffacs()
- {
- #ifdef SUN
- Pint type, cat_len, cat_st, sat_len, sat_st, tcat_len;
- Pint tcat_st, psc_len, psc_st, err;
- Pint tot_cat_len, tot_sat_len;
- Pint tot_tcat_len, tot_psc_len;
- Pcurvsurf_facs facil;
-
- readwstype(&type);
- cat_st = readinteger("curve approx types, starting position ? ");
- sat_st = readinteger("surface approx types, starting position ? ");
- tcat_st = readinteger("trim curve approx types, starting position ? ");
- psc_st = readinteger("param surface characs list, starting position ? ");
- pinq_curv_surf_facs(type, 0, cat_st, 0, sat_st, 0, tcat_st,
- 0, psc_st, &err, &facil, &tot_cat_len,
- &tot_sat_len, &tot_tcat_len, &tot_psc_len);
- facil.cat_types.ints = (Pint *)calloc(tot_cat_len, sizeof(Pint));
- facil.sat_types.ints = (Pint *)calloc(tot_sat_len, sizeof(Pint));
- facil.tcat_types.ints = (Pint *)calloc(tot_tcat_len, sizeof(Pint));
- facil.psc_types.ints = (Pint *)calloc(tot_psc_len, sizeof(Pint));
- pinq_curv_surf_facs(type, tot_cat_len, cat_st, tot_sat_len, sat_st,
- tot_tcat_len, tcat_st, tot_psc_len, psc_st,
- &err, &facil, &tot_cat_len,
- &tot_sat_len, &tot_tcat_len, &tot_psc_len);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- phinprintf(PTKEINFORM, "max B-spline order = %d\n",
- facil.max_bsp_order);
- phinprintf(PTKEINFORM, "max trim curve order = %d\n",
- facil.max_tc_order);
- phinprintf(PTKEINFORM, "curve approx types:\n");
- phinprintf(PTKEINFORM, "number = ");
- writeintlst(PTKEINFORM, &facil.cat_types, PTKENOTABLE);
- phinprintf(PTKEINFORM, "surface approx types:\n");
- phinprintf(PTKEINFORM, "number = ");
- writeintlst(PTKEINFORM, &facil.sat_types, PTKENOTABLE);
- phinprintf(PTKEINFORM, "trim curve approx types:\n");
- phinprintf(PTKEINFORM, "number = ");
- writeintlst(PTKEINFORM, &facil.tcat_types, PTKENOTABLE);
- phinprintf(PTKEINFORM, "parametric surface characteristics:\n");
- phinprintf(PTKEINFORM, "number = ");
- writeintlst(PTKEINFORM, &facil.psc_types, PTKENOTABLE);
- }
- else
- phigserror(PTKEINFORM, err);
- }
- free(facil.cat_types.ints);
- free(facil.sat_types.ints);
- free(facil.tcat_types.ints);
- free(facil.psc_types.ints);
- #endif
- } /* do_pinqcurvsurffacs */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqdatamapfacs()
- {
- #ifdef SUN
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- phintererror(1, (char *)NULL, INFORM);
- #endif
- } /* do_pinqdatamapfacs */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqdatamaprep()
- {
- #ifdef SUN
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- phintererror(1, (char *)NULL, INFORM);
- #endif
- } /* do_pinqdatamaprep */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqdcuefacs()
- {
- #ifdef SUN
- Pint type, err, facs;
-
- readwstype(&type);
- pinq_dcue_facs(type, &err, &facs);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- phinprintf(PTKEINFORM, "number of predefined depth cue indices = %d\n",
- facs);
- }
- else
- phigserror(PTKEINFORM, err);
- }
- #endif
- } /* do_pinqdcuefacs */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqdcuerep()
- {
- #ifdef SUN
- Pint ws, index, err;
- Pinq_type type;
- Pdcue_bundle rep;
-
- ws = readinteger("workstation identifier ? ");
- index = readinteger("depth cue index ? ");
- type = readphigsenum(PTKEINQTYPE, "inquire type ? ");
- pinq_dcue_rep(ws, index, type, &err, &rep);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- phinprintf(PTKEINFORM, "depth cue mode = ");
- writephigsenum(PTKEINFORM, PTKEDCUEMODE, rep.mode);
- phinprintf(PTKEINFORM, "back reference plane = %f\n",
- rep.ref_planes[0]);
- phinprintf(PTKEINFORM, "front reference plane = %f\n",
- rep.ref_planes[1]);
- phinprintf(PTKEINFORM, "back scaling = %f\n",
- rep.scaling[0]);
- phinprintf(PTKEINFORM, "front scaling = %f\n",
- rep.scaling[1]);
- phinprintf(PTKEINFORM, "depth cue colour:\n");
- phinprintf(PTKEINFORM, "colour type = ");
- writegcolr(PTKEINFORM, &rep.colr);
- }
- else
- phigserror(PTKEINFORM, err);
- }
- #endif
- } /* do_pinqdcuerep */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqdirectcolrmodelfacs()
- {
- #ifdef SUN
- Pint type, length, start, err, totlen;
- Pint_list models;
-
- readwstype(&type);
- start = readinteger("starting position ? ");
- pinq_direct_colr_model_facs(type, 0, start, &err, &totlen, &models);
- models.ints = (Pint *)calloc(totlen, sizeof(Pint));
- pinq_direct_colr_model_facs(type, totlen, start, &err, &totlen, &models);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- phinprintf(PTKEINFORM, "available colour models:\n");
- phinprintf(PTKEINFORM, "number = ");
- writeintlst(PTKEINFORM, &models, PTKENOTABLE);
- }
- else
- phigserror(PTKEINFORM, err);
- }
- free(models.ints);
- #endif
- } /* do_pinqdirectcolrmodelfacs */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqdynswsattrsplus()
- {
- #ifdef SUN
- Pint type, err;
- Pdyns_ws_attrs_plus attr;
-
- readwstype(&type);
- pinq_dyns_ws_attrs_plus(type, &err, &attr);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- phinprintf(PTKEINFORM, "light source representation = ");
- writephigsenum(PTKEINFORM, PTKEMODTYPE, attr.light_src_rep);
- phinprintf(PTKEINFORM, "depth cue representation = ");
- writephigsenum(PTKEINFORM, PTKEMODTYPE, attr.dcue_rep);
- phinprintf(PTKEINFORM, "colour map representation = ");
- writephigsenum(PTKEINFORM, PTKEMODTYPE, attr.colr_map_rep);
- }
- else
- phigserror(PTKEINFORM, err);
- }
- #endif
- } /* do_pinqdynswsattrsplus */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqedgerepplus()
- {
- #ifdef SUN
- Pint ws, index, err;
- Pinq_type type;
- Pedge_bundle_plus rep;
-
- ws = readinteger("workstation identifier ? ");
- index = readinteger("edge index ? ");
- type = readphigsenum(PTKEINQTYPE, "inquire type ? ");
- pinq_edge_rep_plus(ws, index, type, &err, &rep);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- phinprintf(PTKEINFORM, "edge representation plus:\n");
- writeedgebundleplus(PTKEINFORM, &rep);
- }
- else
- phigserror(PTKEINFORM, err);
- }
- #endif
- } /* do_pinqedgerepplus */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqintfacsplus()
- {
- #ifdef SUN
- Pint type, is_st, hs_st;
- Pint re_st, sh_st, err;
- Pint tot_is_len, tot_hs_len;
- Pint tot_re_len, tot_sh_len;
- Pint_facs_plus facil;
-
- readwstype(&type);
- is_st = readinteger("interior styles, starting position ? ");
- hs_st = readinteger("hatch styles, starting position ? ");
- re_st = readinteger("reflectance models, starting position ? ");
- sh_st = readinteger("shading methods, starting position ? ");
- pinq_curv_surf_facs(type, 0, is_st, 0, hs_st, 0, re_st,
- 0, sh_st, &err, &facil, &tot_is_len,
- &tot_hs_len, &tot_re_len, &tot_sh_len);
- facil.int_styles = (Pint_style *)calloc(tot_is_len, sizeof(Pint_style));
- facil.hatch_styles.ints = (Pint *)calloc(tot_hs_len, sizeof(Pint));
- facil.refl_eqns.ints = (Pint *)calloc(tot_re_len, sizeof(Pint));
- facil.shad_meths.ints = (Pint *)calloc(tot_sh_len, sizeof(Pint));
- pinq_int_facs_plus(type, tot_is_len, is_st, tot_hs_len, hs_st,
- tot_re_len, re_st, tot_sh_len, sh_st,
- &err, &facil, &tot_is_len,
- &tot_hs_len, &tot_re_len, &tot_sh_len);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- phinprintf(PTKEINFORM, "interior styles:\n");
- writeenumlist(PTKEINFORM, PTKEINTERSTYLE, facil.num_int_styles,
- facil.int_styles);
- phinprintf(PTKEINFORM, "hatch styles:\n");
- phinprintf(PTKEINFORM, "number = ");
- writeintlst(PTKEINFORM, &facil.hatch_styles, PTKENOTABLE);
- phinprintf(PTKEINFORM, "number of predefined interior bundles = ");
- writeinteger(PTKEINFORM, facil.num_pred_inds);
- phinprintf(PTKEINFORM, "reflectance models:\n");
- phinprintf(PTKEINFORM, "number = ");
- writeintlst(PTKEINFORM, &facil.refl_eqns, PTKENOTABLE);
- phinprintf(PTKEINFORM, "shading methods:\n");
- phinprintf(PTKEINFORM, "number = ");
- writeintlst(PTKEINFORM, &facil.shad_meths, PTKENOTABLE);
- }
- else
- phigserror(PTKEINFORM, err);
- }
- free(facil.int_styles);
- free(facil.hatch_styles.ints);
- free(facil.refl_eqns.ints);
- free(facil.shad_meths.ints);
- #endif
- } /* do_pinqintfacsplus */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqintrepplus()
- {
- #ifdef SUN
- Pint wsid, index, err;
- Pinq_type type;
- Pint_bundle_plus rep;
-
- wsid = readinteger("workstation identifier ? ");
- index = readinteger("interior index ? ");
- type = readphigsenum(PTKEINQTYPE, "type of value ? ");
- pinq_int_rep_plus(wsid, index, type, &err, &rep);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- phinprintf(PTKEINFORM, "interior representation:\n");
- writeinterbundleplus(PTKEINFORM, &rep);
- }
- else
- phigserror(PTKEINFORM, err);
- }
- #endif
- } /* do_pinqintrepplus */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqlightsrcfacs()
- {
- #ifdef SUN
- Pint type, start, err, totlen;
- Plight_src_facs facs;
-
- readwstype(&type);
- start = readinteger("starting position ? ");
- pinq_light_src_facs(type, 0, start, &err, &facs, &totlen);
- facs.types.ints = (Pint *)calloc(totlen, sizeof(Pint));
- pinq_light_src_facs(type, 0, start, &err, &facs, &totlen);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- phinprintf(PTKEINFORM, "light source types:\n");
- phinprintf(PTKEINFORM, "number = ");
- writeintlst(PTKEINFORM, &facs.types, PTKENOTABLE);
- phinprintf(PTKEINFORM,
- "max number of simultaneously active lights = %d\n", facs.max);
- phinprintf(PTKEINFORM, "number of predefined light bundles = %d\n",
- facs.num_pred_inds);
- }
- else
- phigserror(PTKEINFORM, err);
- }
- free(facs.types.ints);
- #endif
- } /* do_pinqlightsrcfacs */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqlightsrcrep()
- {
- #ifdef SUN
- Pint ws, index, err;
- Pinq_type type;
- Plight_src_bundle rep;
-
- ws = readinteger("workstation identifier ? ");
- index = readinteger("light source index ? ");
- type = readphigsenum(PTKEINQTYPE, "inquire type ? ");
- pinq_light_src_rep(ws, index, type, &err, &rep);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- writelightsrcbundle(PTKEINFORM, &rep);
- }
- else
- phigserror(PTKEINFORM, err);
- }
- #endif
- } /* do_pinqlightsrcrep */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqlistcolrmapinds()
- {
- #ifdef SUN
- Pint ws, start, err, totlen;
- Pint_list indices;
-
- ws = readinteger("workstation identifier ? ");
- start = readinteger("starting position ? ");
- pinq_list_colr_map_inds(ws, 0, start, &err, &indices, &totlen);
- indices.ints = (Pint *)calloc(totlen, sizeof(Pint));
- pinq_list_colr_map_inds(ws, totlen, start, &err, &indices, &totlen);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- phinprintf(PTKEINFORM, "colour mapping indices:\n");
- phinprintf(PTKEINFORM, "number = ");
- writeintlst(PTKEINFORM, &indices, PTKENOTABLE);
- }
- else
- phigserror(PTKEINFORM, err);
- }
- free(indices.ints);
- #endif
- } /* do_pinqlistcolrmapinds */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqlistdatamapinds()
- {
- #ifdef SUN
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- phintererror(1, (char *)NULL, INFORM);
- #endif
- } /* do_pinqlistdatamapinds */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqlistdcueinds()
- {
- #ifdef SUN
- Pint ws, start, err, totlen;
- Pint_list indices;
-
- ws = readinteger("workstation identifier ? ");
- start = readinteger("starting position ? ");
- pinq_list_dcue_inds(ws, 0, start, &err, &indices, &totlen);
- indices.ints = (Pint *)calloc(totlen, sizeof(Pint));
- pinq_list_dcue_inds(ws, totlen, start, &err, &indices, &totlen);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- phinprintf(PTKEINFORM, "depth cue indices:\n");
- phinprintf(PTKEINFORM, "number = ");
- writeintlst(PTKEINFORM, &indices, PTKENOTABLE);
- }
- else
- phigserror(PTKEINFORM, err);
- }
- free(indices.ints);
- #endif
- } /* do_pinqlistdcueinds */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqlistlightsrcinds()
- {
- #ifdef SUN
- Pint ws, start, err, totlen;
- Pint_list indices;
-
- ws = readinteger("workstation identifier ? ");
- start = readinteger("starting position ? ");
- pinq_list_light_src_inds(ws, 0, start, &err, &indices, &totlen);
- indices.ints = (Pint *)calloc(totlen, sizeof(Pint));
- pinq_list_light_src_inds(ws, totlen, start, &err, &indices, &totlen);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- phinprintf(PTKEINFORM, "light source indices:\n");
- phinprintf(PTKEINFORM, "number = ");
- writeintlst(PTKEINFORM, &indices, PTKENOTABLE);
- }
- else
- phigserror(PTKEINFORM, err);
- }
- free(indices.ints);
- #endif
- } /* do_pinqlistlightsrcinds */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqlistparamsurfinds()
- {
- #ifdef SUN
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- phintererror(1, (char *)NULL, INFORM);
- #endif
- } /* do_pinqlistparamsurfinds */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqlistreflinds()
- {
- #ifdef SUN
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- phintererror(1, (char *)NULL, INFORM);
- #endif
- } /* do_pinqlistreflinds */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqparamsurfrep()
- {
- #ifdef SUN
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- phintererror(1, (char *)NULL, INFORM);
- #endif
- } /* do_pinqparamsurfrep */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqpatrepplus()
- {
- #ifdef SUN
- Pint wsid, index, err, numcols;
- Pinq_type type;
- Pstore store;
- Ppat_rep_plus *rep;
-
- wsid = readinteger("workstation identifier ? ");
- index = readinteger("pattern index ? ");
- type = readphigsenum(PTKEINQTYPE, "inquire type ? ");
- pcreate_store(&err, &store);
- pinq_pat_rep_plus(wsid, index, type, store, &err, &rep);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- phinprintf(PTKEINFORM, "pattern representation:\n");
- phinprintf(PTKEINFORM, "dimensions, x = %d, y = %d\n",
- rep->dims.size_x, rep->dims.size_y);
- phinprintf(PTKEINFORM, "colour type = %d\n", rep->type);
- numcols = rep->dims.size_x * rep->dims.size_y;
- phinprintf(PTKEINFORM, "colour grid:\n");
- writecovalarray(PTKEINFORM, numcols, rep->colr_array);
- }
- else
- phigserror(PTKEINFORM, err);
- }
- pdel_store(store);
- #endif
- } /* do_pinqpatrepplus */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqlinefacsplus()
- {
- #ifdef SUN
- Pint wstype, lt_st, sm_st, tlt_len, tsm_len, err;
- Pline_facs_plus facil;
-
- readwstype(&wstype);
- lt_st = readinteger("curve approx types, starting position ? ");
- sm_st = readinteger("surface approx types, starting position ? ");
- pinq_line_facs_plus(wstype, 0, lt_st, 0, sm_st, &err, &facil, &tlt_len,
- &tsm_len);
- facil.types.ints = (Pint *)calloc(tlt_len, sizeof(Pint));
- facil.shads.ints = (Pint *)calloc(tsm_len, sizeof(Pint));
- pinq_line_facs_plus(wstype, tlt_len, lt_st, tsm_len, sm_st,
- &err, &facil, &tlt_len, &tsm_len);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- phinprintf(PTKEINFORM, "line types:\n");
- phinprintf(PTKEINFORM, "number = ");
- writeintlst(PTKEINFORM, &facil.types, PTKENOTABLE);
- phinprintf(PTKEINFORM, "number of available line widths = %d\n",
- facil.num_widths);
- phinprintf(PTKEINFORM, "nominal line width = %f\n",
- facil.nom_width);
- phinprintf(PTKEINFORM, "minimum line width = %f\n",
- facil.min_width);
- phinprintf(PTKEINFORM, "maximum line width = %f\n",
- facil.max_width);
- phinprintf(PTKEINFORM, "number of predefined bundles = %d\n",
- facil.num_pred_inds);
- phinprintf(PTKEINFORM, "shading methods:\n");
- phinprintf(PTKEINFORM, "number = ");
- writeintlst(PTKEINFORM, &facil.shads, PTKENOTABLE);
- }
- else
- phigserror(PTKEINFORM, err);
- }
- free(facil.types.ints);
- free(facil.shads.ints);
- #endif
- } /* do_pinqlinefacsplus */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqlinerepplus()
- {
- #ifdef SUN
- Pint wsid, index, err;
- Pinq_type type;
- Pline_bundle_plus rep;
-
- wsid = readinteger("workstation identifier ? ");
- index = readinteger("line index ? ");
- type = readphigsenum(PTKEINQTYPE, "inquire type ? ");
- pinq_line_rep_plus(wsid, index, type, &err, &rep);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- phinprintf(PTKEINFORM, "line representation:\n");
- writelinebundleplus(PTKEINFORM, &rep);
- }
- else
- phigserror(PTKEINFORM, err);
- }
- #endif
- } /* do_pinqlinerepplus */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqmarkerrepplus()
- {
- #ifdef SUN
- Pint wsid, index, err;
- Pinq_type type;
- Pmarker_bundle_plus rep;
-
- wsid = readinteger("workstation identifier ? ");
- index = readinteger("marker index ? ");
- type = readphigsenum(PTKEINQTYPE, "inquire type ? ");
- pinq_marker_rep_plus(wsid, index, type, &err, &rep);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- phinprintf(PTKEINFORM, "marker representation:\n");
- writemarkerbundleplus(PTKEINFORM, &rep);
- }
- else
- phigserror(PTKEINFORM, err);
- }
- #endif
- } /* do_pinqmarkerrepplus */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqpredcolrmaprep()
- {
- #ifdef SUN
- Pint ws_type, index, err, map_method, i;
- Pstore store;
- Pcolr_map_data *map_data;
-
- readwstype(&ws_type);
- index = readinteger("colour map index ? ");
- pcreate_store(&err, &store);
- pinq_pred_colr_map_rep(ws_type, index, store, &err, &map_method,
- &map_data);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- phinprintf(PTKEINFORM, "colour mapping representation:\n");
- phinprintf(PTKEINFORM, "colour mapping method = %d\n", map_method);
- switch (map_method)
- {
- case PCOLR_MAP_TRUE:
- break;
-
- case PCOLR_MAP_PSEUDO:
- phinprintf(PTKEINFORM, "colour model = %d\n",
- map_data->meth_r2.colr_model);
- phinprintf(PTKEINFORM, "weights:\n");
- phinprintf(PTKEINFORM, "number = ");
- writefloatlist(PTKEINFORM, &map_data->meth_r2.weights);
- writecolreplist(PTKEINFORM, map_data->meth_r2.colr_model,
- &map_data->meth_r2.colrs);
- break;
-
- case PCOLR_MAP_PSEUDO_N:
- phinprintf(PTKEINFORM, "colour model = %d\n",
- map_data->meth_r3.colr_model);
- phinprintf(PTKEINFORM, "direct colours:\n");
- phinprintf(PTKEINFORM, "number = ");
- writeinteger(PTKEINFORM, map_data->meth_r3.colr_lists.num_lists);
- for (i = 0; i < map_data->meth_r3.colr_lists.num_lists; i++)
- writefloatlist(PTKEINFORM,
- &map_data->meth_r3.colr_lists.lists[i]);
- break;
-
- }
- }
- else
- phigserror(PTKEINFORM, err);
- }
- pdel_store(store);
- #endif
- } /* do_pinqpredcolrmaprep */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqpreddatamaprep()
- {
- #ifdef SUN
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- phintererror(1, (char *)NULL, INFORM);
- #endif
- } /* do_pinqpreddatamaprep */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqpreddcuerep()
- {
- #ifdef SUN
- Pint wstype, index, err;
- Pdcue_bundle rep;
-
- readwstype(&wstype);
- index = readinteger("depth cue index ? ");
- pinq_pred_dcue_rep(wstype, index, &err, &rep);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- phinprintf(PTKEINFORM, "depth cue representation:\n");
- phinprintf(PTKEINFORM, "depth cue mode = ");
- writephigsenum(PTKEINFORM, PTKEDCUEMODE, rep.mode);
- phinprintf(PTKEINFORM, "back reference plane = %f\n",
- rep.ref_planes[0]);
- phinprintf(PTKEINFORM, "front reference plane = %f\n",
- rep.ref_planes[1]);
- phinprintf(PTKEINFORM, "back scaling = %f\n",
- rep.scaling[0]);
- phinprintf(PTKEINFORM, "front scaling = %f\n",
- rep.scaling[1]);
- phinprintf(PTKEINFORM, "depth cue colour:\n");
- phinprintf(PTKEINFORM, "colour type = ");
- writegcolr(PTKEINFORM, &rep.colr);
- }
- else
- phigserror(PTKEINFORM, err);
- }
- #endif
- } /* do_pinqpreddcuerep */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqprededgerepplus()
- {
- #ifdef SUN
- Pint wstype, index, err;
- Pedge_bundle_plus rep;
-
- readwstype(&wstype);
- index = readinteger("edge index ? ");
- pinq_pred_edge_rep_plus(wstype, index, &err, &rep);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- phinprintf(PTKEINFORM, "edge representation plus:\n");
- writeedgebundleplus(PTKEINFORM, &rep);
- }
- else
- phigserror(PTKEINFORM, err);
- }
- #endif
- } /* do_pinqprededgerepplus */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqpredintrepplus()
- {
- #ifdef SUN
- Pint wstype, index, err;
- Pint_bundle_plus rep;
-
- readwstype(&wstype);
- pinq_pred_int_rep_plus(wstype, index, &err, &rep);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- phinprintf(PTKEINFORM, "interior representation:\n");
- writeinterbundleplus(PTKEINFORM, &rep);
- }
- else
- phigserror(PTKEINFORM, err);
- }
- #endif
- } /* do_pinqpredintrepplus */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqpredlightsrcrep()
- {
- #ifdef SUN
- Pint wstype, index, err;
- Plight_src_bundle rep;
-
- readwstype(&wstype);
- index = readinteger("light source index ? ");
- pinq_pred_light_src_rep(wstype, index, &err, &rep);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- writelightsrcbundle(PTKEINFORM, &rep);
- }
- else
- phigserror(PTKEINFORM, err);
- }
- #endif
- } /* do_pinqpredlightsrcrep */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqpredparamsurfrep()
- {
- #ifdef SUN
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- phintererror(1, (char *)NULL, INFORM);
- #endif
- } /* do_pinqpredparamsurfrep */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqpredpatrepplus()
- {
- #ifdef SUN
- Pint wstype, index, err, numcols;
- Ppat_rep_plus rep;
- Pstore store;
-
- readwstype(&wstype);
- index = readinteger("pattern index ? ");
- pcreate_store(&err, &store);
- pinq_pred_pat_rep_plus(wstype, index, store, &err, &rep);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- phinprintf(PTKEINFORM, "pattern representation:\n");
- phinprintf(PTKEINFORM, "dimensions, x = %d, y = %d\n",
- rep.dims.size_x, rep.dims.size_y);
- phinprintf(PTKEINFORM, "colour type = %d\n", rep.type);
- numcols = rep.dims.size_x * rep.dims.size_y;
- phinprintf(PTKEINFORM, "colour grid:\n");
- writecovalarray(PTKEINFORM, numcols, rep.colr_array);
- }
- else
- phigserror(PTKEINFORM, err);
- }
- pdel_store(store);
- #endif
- } /* do_pinqpredpatrepplus */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqpredlinerepplus()
- {
- #ifdef SUN
- Pint wstype, index, err;
- Pline_bundle_plus rep;
-
- readwstype(&wstype);
- index = readinteger("line index ? ");
- pinq_pred_line_rep_plus(wstype, index, &err, &rep);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- phinprintf(PTKEINFORM, "line representation:\n");
- writelinebundleplus(PTKEINFORM, &rep);
- }
- else
- phigserror(PTKEINFORM, err);
- }
- #endif
- } /* do_pinqpredlinerepplus */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqpredmarkerrepplus()
- {
- #ifdef SUN
- Pint wstype, index, err;
- Pmarker_bundle_plus rep;
-
- readwstype(&wstype);
- index = readinteger("marker index ? ");
- pinq_pred_marker_rep_plus(wstype, index, &err, &rep);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- phinprintf(PTKEINFORM, "marker representation:\n");
- writemarkerbundleplus(PTKEINFORM, &rep);
- }
- else
- phigserror(PTKEINFORM, err);
- }
- #endif
- } /* do_pinqpredmarkerrepplus */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqpredreflrep()
- {
- #ifdef SUN
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- phintererror(1, (char *)NULL, INFORM);
- #endif
- } /* do_pinqpredreflrep */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqpredtextrepplus()
- {
- #ifdef SUN
- Pint wstype, index, err;
- Ptext_bundle_plus rep;
-
- readwstype(&wstype);
- index = readinteger("text index ? ");
- pinq_pred_text_rep_plus(wstype, index, &err, &rep);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- phinprintf(PTKEINFORM, "text representation:\n");
- writetextbundleplus(PTKEINFORM, &rep);
- }
- else
- phigserror(PTKEINFORM, err);
- }
- #endif
- } /* do_pinqpredtextrepplus */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqreflfacs()
- {
- #ifdef SUN
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- phintererror(1, (char *)NULL, INFORM);
- #endif
- } /* do_pinqreflfacs */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqreflrep()
- {
- #ifdef SUN
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- phintererror(1, (char *)NULL, INFORM);
- #endif
- } /* do_pinqreflrep */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqrenderingcolrmodelfacs()
- {
- #ifdef SUN
- Pint type, start, err, totlen;
- Pint_list models;
-
- readwstype(&type);
- start = readinteger("starting position ? ");
- pinq_rendering_colr_model_facs(type, 0, start, &err, &models, &totlen);
- models.ints = (Pint *)calloc(totlen, sizeof(Pint));
- pinq_rendering_colr_model_facs(type, totlen, start, &err, &models, &totlen);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- phinprintf(PTKEINFORM, "rendering colour model facilities:\n");
- phinprintf(PTKEINFORM, "number = ");
- writeintlst(PTKEINFORM, &models, PTKENOTABLE);
- }
- else
- phigserror(PTKEINFORM, err);
- }
- #endif
- } /* do_pinqrenderingcolrmodelfacs */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqtextrepplus()
- {
- #ifdef SUN
- Pint ws, index, err;
- Pinq_type type;
- Ptext_bundle_plus rep;
-
- ws = readinteger("workstation identifier ? ");
- index = readinteger("text index ? ");
- type = readphigsenum(PTKEINQTYPE, "inquire type ? ");
- pinq_text_rep_plus(ws, index, type, &err, &rep);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- phinprintf(PTKEINFORM, "text representation:\n");
- writetextbundleplus(PTKEINFORM, &rep);
- }
- else
- phigserror(PTKEINFORM, err);
- }
- #endif
- } /* do_pinqtextrepplus */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pinqwssttableplus()
- {
- #ifdef SUN
- Pint wstype;
- Pint err;
- Pws_tables_plus lengths;
-
- readwstype(&wstype);
- pinq_ws_st_table_plus(wstype, &err, &lengths);
- if (writeinform)
- {
- phinprintf(PTKEINFORM, "--- %s ---\n", phigsnamelist[activefunction]);
- if (err == 0)
- {
- phinprintf(PTKEINFORM, "lengths of workstation state tables:\n");
- phinprintf(PTKEINFORM, "line = ");
- writeinteger(PTKEINFORM, lengths.line_bundles);
- phinprintf(PTKEINFORM, "marker = ");
- writeinteger(PTKEINFORM, lengths.mark_bundles);
- phinprintf(PTKEINFORM, "text = ");
- writeinteger(PTKEINFORM, lengths.text_bundles);
- phinprintf(PTKEINFORM, "interior = ");
- writeinteger(PTKEINFORM, lengths.int_bundles);
- phinprintf(PTKEINFORM, "edge = ");
- writeinteger(PTKEINFORM, lengths.edge_bundles);
- phinprintf(PTKEINFORM, "pattern = ");
- writeinteger(PTKEINFORM, lengths.pat_reps);
- phinprintf(PTKEINFORM, "colour = ");
- writeinteger(PTKEINFORM, lengths.colr_reps);
- phinprintf(PTKEINFORM, "view = ");
- writeinteger(PTKEINFORM, lengths.view_reps);
- phinprintf(PTKEINFORM, "depth cue = ");
- writeinteger(PTKEINFORM, lengths.dcue_rep);
- phinprintf(PTKEINFORM, "light source = ");
- writeinteger(PTKEINFORM, lengths.light_src_rep);
- phinprintf(PTKEINFORM, "colour mapping = ");
- writeinteger(PTKEINFORM, lengths.colr_map_rep);
- }
- else
- phigserror(PTKEINFORM, err);
- }
- #endif
- } /* do_pinqwssttableplus */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pnunibsplcurv()
- {
- #ifdef SUN
- Pint order;
- Pfloat_list knots;
- Prational rationality;
- Ppoint_list34 cpoints;
- Pfloat min, max;
-
- order = readinteger("spline order ? ");
- readfloatlist(&knots, "knots");
- rationality = readphigsenum(PTKERATIONAL, "rationality ? ");
- readpointlist34(rationality, &cpoints, "control points ? ");
- min = readreal("curve range, minimum ? ");
- max = readreal("curve range, maximum ? ");
- pnuni_bsp_curv(order, &knots, rationality, &cpoints, min, max);
- free(knots.floats);
- if (rationality == PRATIONAL)
- free(cpoints.points.point4d);
- else
- free(cpoints.points.point3d);
- #endif
- } /* do_pnunibsplcurv */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pnunibsplcurvcolr()
- {
- #ifdef SUN
- phintererror(1, (char *)NULL, INFORM);
- #endif
- } /* do_pnunibsplcurvcolr */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pnunibsplsurf()
- {
- #ifdef SUN
- Pint uorder, vorder, nloops, i, j;
- Pfloat_list uknots, vknots;
- Prational rationality;
- Ppoint_grid34 grid;
- Ptrimcurve_list *tloops;
- char prom[80];
-
- uorder = readinteger("U spline order ? ");
- vorder = readinteger("V spline order ? ");
- readfloatlist(&uknots, "U knots");
- readfloatlist(&vknots, "V knots");
- rationality = readphigsenum(PTKERATIONAL, "rationality ? ");
- readpointgrid34(rationality, &grid, "control grid");
- nloops = readinteger("number of trim curve loops ? ");
- tloops = (Ptrimcurve_list *)calloc(nloops, sizeof(Ptrimcurve_list));
- for (i = 0; i < nloops; i++)
- {
- sprintf(prom, "trim curve loop [%d]", i);
- readtrimcurvelist(&tloops[i], prom);
- }
- pnuni_bsp_surf(uorder, vorder, &uknots, &vknots, rationality, &grid,
- nloops, tloops);
- free(uknots.floats);
- free(vknots.floats);
- if (rationality == PRATIONAL)
- free(grid.points.point4d);
- else
- free(grid.points.point3d);
- for (i = 0; i < nloops; i++)
- {
- for (j = 0; j < tloops[i].num_curves; j++)
- {
- free(tloops[i].curves[j].knots.floats);
- if (tloops[i].curves[j].rationality == PRATIONAL)
- free(tloops[i].curves[j].cpts.points.point3d);
- else
- free(tloops[i].curves[j].cpts.points.point2d);
- }
- free(tloops[i].curves);
- }
- free(tloops);
- #endif
- } /* do_pnunibsplsurf */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pnunibsplsurfdata()
- {
- #ifdef SUN
- phintererror(1, (char *)NULL, INFORM);
- #endif
- } /* do_pnunibsplsurfdata */
-
- /*------------------------------------------------------------------------*/
-
- static void do_ppolylineset3data()
- {
- #ifdef SUN
- Pint vflag, colour_model, npl, i;
- Pline_vdata_list3 *vdata;
-
- vflag = readinteger("vertex data flag ? ");
- colour_model = readinteger("colour model ? ");
- npl = readinteger("number of polylines ? ");
- vdata = (Pline_vdata_list3 *)calloc(npl, sizeof(Pline_vdata_list3));
- for (i = 0; i < npl; i++)
- readlinevdatalist3(vflag, colour_model, i, &vdata[i]);
- ppolyline_set3_data(vflag, colour_model, npl, vdata);
- for (i = 0; i < npl; i++)
- {
- switch (vflag)
- {
- case PVERT_COORD:
- free(vdata[i].vertex_data.points);
- break;
-
- case PVERT_COORD_COLOUR:
- free(vdata[i].vertex_data.ptcolrs);
- break;
- }
- }
- free(vdata);
- #endif
- } /* do_ppolylineset3data */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pquadmesh3data()
- {
- #ifdef SUN
- Pint fflag, vflag, colour_model, numfacets, i;
- Pint_size dim;
- Pfacet_data_arr3 fdata;
- Pfacet_vdata_arr3 vdata;
-
- fflag = readinteger("facet data flag ? ");
- vflag = readinteger("vertex data flag ? ");
- colour_model = readinteger("colour model ? ");
- dim.size_x = readinteger("number of vertices along the x-axis ? ");
- dim.size_y = readinteger("number of vertices along the y-axis ? ");
- numfacets = (dim.size_x) * (dim.size_y);
- readfacetdataarr3(fflag, colour_model, numfacets, &fdata);
- readfacetvdataarr3(vflag, colour_model, numfacets, &vdata);
- pquad_mesh3_data(fflag, vflag, colour_model, &dim, &fdata, &vdata);
- switch (fflag)
- {
- case PFACET_NONE:
- break;
-
- case PFACET_COLOUR:
- free(fdata.colrs);
- break;
-
- case PFACET_NORMAL:
- free(fdata.norms);
- break;
-
- case PFACET_COLOUR_NORMAL:
- free(fdata.conorms);
- break;
- }
- switch (vflag)
- {
- case PVERT_COORD:
- free(vdata.points);
- break;
-
- case PVERT_COORD_COLOUR:
- free(vdata.ptcolrs);
- break;
-
- case PVERT_COORD_NORMAL:
- free(vdata.ptnorms);
- break;
-
- case PVERT_COORD_COLOUR_NORMAL:
- free(vdata.ptconorms);
- break;
- }
- #endif
- } /* do_pquadmesh3data */
-
- /*------------------------------------------------------------------------*/
-
- static void do_pquadmeshdata()
- {
- #ifdef SUN
- phintererror(1, (char *)NULL, INFORM);
- #endif
- } /* do_pquadmeshdata */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetbackdatamapind()
- {
- #ifdef SUN
- phintererror(1, (char *)NULL, INFORM);
- #endif
- } /* do_psetbackdatamapind */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetbackdatamapmeth()
- {
- #ifdef SUN
- phintererror(1, (char *)NULL, INFORM);
- #endif
- } /* do_psetbackdatamapmeth */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetbackintcolr()
- {
- #ifdef SUN
- Pgcolr colour;
-
- readgcolr(&colour, "back interior colour");
- pset_back_int_colr(&colour);
- #endif
- } /* do_psetbackintcolr */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetbackintind()
- {
- #ifdef SUN
- phintererror(1, (char *)NULL, INFORM);
- #endif
- } /* do_psetbackintind */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetbackintshadmeth()
- {
- #ifdef SUN
- pset_back_int_shad_meth(readinteger("back shading method ? "));
- #endif
- } /* do_psetbackintshadmeth */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetbackintstyle()
- {
- #ifdef SUN
- Pint_style style;
-
- style = readphigsenum(PTKEINTERSTYLE, "back interior style ? ");
- pset_back_int_style(style);
- #endif
- } /* do_psetbackintstyle */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetbackintstyleind()
- {
- #ifdef SUN
- pset_back_int_style_ind(readinteger("back interior style index ? "));
- #endif
- } /* do_psetbackintstyleind */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetbackreflind()
- {
- #ifdef SUN
- phintererror(1, (char *)NULL, INFORM);
- #endif
- } /* do_psetbackreflind */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetbackreflmodel()
- {
- #ifdef SUN
- pset_back_refl_eqn(readinteger("back reflectance model ? "));
- #endif
- } /* do_psetbackreflmodel */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetbackreflprops()
- {
- #ifdef SUN
- Prefl_props props;
-
- readreflprops(&props, "back reflectance properties ? ");
- pset_back_refl_props(&props);
- #endif
- } /* do_psetbackreflprops */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetcolrmapind()
- {
- #ifdef SUN
- pset_colr_map_ind(readinteger("colour mapping index ? "));
- #endif
- } /* do_psetcolrmapind */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetcolrmaprep()
- {
- #ifdef SUN
- Pint ws, index, map_method, i;
- Pcolr_map_data map_data;
-
- ws = readinteger("workstation identifier ? ");
- index = readinteger("colour mapping index ? ");
- map_method = readinteger("mapping method ? ");
- readcolrmapdata(map_method, &map_data, "colour map");
- pset_colr_map_rep(ws, index, map_method, &map_data);
- switch (map_method)
- {
- case PCOLR_MAP_TRUE:
- break;
-
- case PCOLR_MAP_PSEUDO:
- free(map_data.meth_r2.weights.floats);
- free(map_data.meth_r2.colrs);
- break;
-
- case PCOLR_MAP_PSEUDO_N:
- free(map_data.meth_r3.colr_lists.lists);
- for (i = 0; i < map_data.meth_r3.colr_lists.num_lists; i++)
- free(map_data.meth_r3.colr_lists.lists[i].floats);
- break;
- }
- #endif
- } /* do_psetcolrmaprep */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetcurvapprox()
- {
- #ifdef SUN
- Pint type;
- Pfloat value;
-
- type = readinteger("curve approx type ? ");
- value = readreal("curve approx value ? ");
- pset_curve_approx(type, value);
- #endif
- } /* do_psetcurvapprox */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetdatamapind()
- {
- #ifdef SUN
- phintererror(1, (char *)NULL, INFORM);
- #endif
- } /* do_psetdatamapind */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetdatamapmeth()
- {
- #ifdef SUN
- phintererror(1, (char *)NULL, INFORM);
- #endif
- } /* do_psetdatamapmeth */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetdatamaprep()
- {
- #ifdef SUN
- phintererror(1, (char *)NULL, INFORM);
- #endif
- } /* do_psetdatamaprep */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetdcueind()
- {
- #ifdef SUN
- pset_dcue_ind(readinteger("depth cue index ? "));
- #endif
- } /* do_psetdcueind */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetdcuerep()
- {
- #ifdef SUN
- Pint ws, index;
- Pdcue_bundle rep;
-
- ws = readinteger("workstation identifier ? ");
- index = readinteger("depth cue index ? ");
- readdcuebundle(&rep);
- pset_dcue_rep(ws, index, &rep);
- #endif
- } /* do_psetdcuerep */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetedgecolr()
- {
- #ifdef SUN
- Pgcolr colour;
-
- readgcolr(&colour, "edge colour");
- pset_edge_colr(&colour);
- #endif
- } /* do_psetedgecolr */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetedgerepplus()
- {
- #ifdef SUN
- Pint ws, index;
- Pedge_bundle_plus rep;
-
- ws = readinteger("workstation identifier ? ");
- index = readinteger("edge bundle index ? ");
- readedgebundleplus(&rep);
- pset_edge_rep_plus(ws, index, &rep);
- #endif
- } /* do_psetedgerepplus */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetfacecullmode()
- {
- #ifdef SUN
- Pcull_mode mode;
-
- mode = readphigsenum(PTKECULLMODE, "face culling mode ? ");
- pset_face_cull_mode(mode);
- #endif
- } /* do_psetfacecullmode */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetfacedistingmode()
- {
- #ifdef SUN
- Pdisting_mode mode;
-
- mode = readphigsenum(PTKEDISTINGMODE, "face distinguishing mode ? ");
- pset_face_disting_mode(mode);
- #endif
- } /* do_psetfacedistingmode */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetintcolr()
- {
- #ifdef SUN
- Pgcolr colour;
-
- readgcolr(&colour, "interior colour ? ");
- pset_int_colr(&colour);
- #endif
- } /* do_psetintcolr */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetintrepplus()
- {
- #ifdef SUN
- Pint wsid, index;
- Pint_bundle_plus rep;
-
- wsid = readinteger("workstation identifier ? ");
- index = readinteger("interior index ? ");
- readinterbundleplus(&rep);
- pset_int_rep_plus(wsid, index, &rep);
- #endif
- } /* do_psetintrepplus */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetintshadmeth()
- {
- #ifdef SUN
- pset_int_shad_meth(readinteger("interior shading method ? "));
- #endif
- } /* do_psetintshadmeth */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetlightsrcrep()
- {
- #ifdef SUN
- Pint ws, index;
- Plight_src_bundle rep;
-
- ws = readinteger("workstation identifier ? ");
- index = readinteger("light index ? ");
- readlightsrcbundle(&rep);
- pset_light_src_rep(ws, index, &rep);
- #endif
- } /* do_psetlightsrcrep */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetlightsrcstate()
- {
- #ifdef SUN
- Pint_list activation, deactivation;
-
- readintlst(&activation, "activation list", PTKENOTABLE);
- readintlst(&deactivation, "deactivation list", PTKENOTABLE);
- pset_light_src_state(&activation, &deactivation);
- free(activation.ints);
- free(deactivation.ints);
- #endif
- } /* do_psetlightsrcstate */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetoffillareasetdata()
- {
- #ifdef SUN
- phintererror(1, (char *)NULL, INFORM);
- #endif
- } /* do_psetoffillareasetdata */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetoffillareaset3data()
- {
- #ifdef SUN
- Pint fflag, eflag, vflag, colour_model, num_sets, i, j;
- Pfacet_data_arr3 fdata;
- Pedge_data_list_list *edata;
- Pfacet_vdata_list3 *vdata;
- Pint_list_list *vlist;
- char prom[80];
-
- fflag = readinteger("facet data flag ? ");
- eflag = readinteger("edge data flag ? ");
- vflag = readinteger("vertex data flag ? ");
- colour_model = readinteger("colour model ? ");
- num_sets = readinteger("number of fill area sets ? ");
- readfacetdataarr3(fflag, colour_model, num_sets, &fdata);
- if (eflag == PEDGE_VISIBILITY)
- {
- edata = (Pedge_data_list_list *)calloc(num_sets,
- sizeof(Pedge_data_list_list));
- for (i = 0; i < num_sets; i++)
- {
- sprintf(prom, "edge data list [%d]", i);
- readedgedatalistlist(prom, &edata[i]);
- }
- }
- vlist = (Pint_list_list *)calloc(num_sets, sizeof(Pint_list_list));
- for (i = 0; i < num_sets; i++)
- {
- sprintf(prom, "facet [%d], number of index lists ? ", i);
- vlist[i].num_lists = readinteger(prom);
- vlist[i].lists = (Pint_list *)calloc(vlist[i].num_lists,
- sizeof(Pint_list));
- for (j = 0; j < vlist[i].num_lists; j++)
- {
- sprintf(prom, "facet [%d], index list [%d]", i, j);
- readintlst(&vlist[i].lists[j], prom, PTKENOTABLE);
- }
- }
- vdata = (Pfacet_vdata_list3 *)calloc(num_sets, sizeof(Pfacet_vdata_list3));
- for (i = 0; i < num_sets; i++)
- readfacetvdatalist3(vflag, colour_model, i, &vdata[i]);
- pset_of_fill_area_set3_data(fflag, eflag, vflag, colour_model,
- num_sets, &fdata, edata, vlist, vdata);
- for (i = 0; i < num_sets; i++)
- {
- switch (vflag)
- {
- case PVERT_COORD:
- free(vdata[i].vertex_data.points);
- break;
-
- case PVERT_COORD_COLOUR:
- free(vdata[i].vertex_data.ptcolrs);
- break;
-
- case PVERT_COORD_NORMAL:
- free(vdata[i].vertex_data.ptnorms);
- break;
-
- case PVERT_COORD_COLOUR_NORMAL:
- free(vdata[i].vertex_data.ptconorms);
- break;
- }
- if (eflag == PEDGE_VISIBILITY)
- for (j = 0; j < edata[i].num_lists; j++)
- free(edata[i].edgelist[j].edgedata.edges);
- for (j = 0; j < vlist[i].num_lists; j++)
- free(vlist[i].lists[j].ints);
- }
- free(vdata);
- free(edata);
- free(vlist);
- switch (fflag)
- {
- case PFACET_NONE:
- break;
-
- case PFACET_COLOUR:
- free(fdata.colrs);
- break;
-
- case PFACET_NORMAL:
- free(fdata.norms);
- break;
-
- case PFACET_COLOUR_NORMAL:
- free(fdata.conorms);
- break;
- }
- #endif
- } /* do_psetoffillareaset3data */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetparamsurfcharacs()
- {
- #ifdef SUN
- Pint psc_type;
- Ppara_surf_characs data;
-
- psc_type = readinteger("parameteric surface characteristic type ? ");
- readparasurfcharacs(psc_type, &data);
- pset_para_surf_characs(psc_type, &data);
- switch (psc_type)
- {
- case PSC_NONE:
- break;
-
- case PSC_WS_DEP:
- break;
-
- case PSC_ISOPARAMETRIC_CURVES:
- break;
-
- case PSC_LEVEL_CURVES_MC:
- free(data.psc_4.params.floats);
- break;
-
- case PSC_LEVEL_CURVES_WC:
- free(data.psc_5.params.floats);
- break;
- }
- #endif
- } /* do_psetparamsurfcharacs */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetparamsurfind()
- {
- #ifdef SUN
- phintererror(1, (char *)NULL, INFORM);
- #endif
- } /* do_psetparamsurfind */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetparamsurfrep()
- {
- #ifdef SUN
- phintererror(1, (char *)NULL, INFORM);
- #endif
- } /* do_psetparamsurfrep */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetpatrepplus()
- {
- #ifdef SUN
- Pint ws, index;
- Ppat_rep_plus rep;
-
- ws = readinteger("workstation identifier ? ");
- index = readinteger("pattern index ? ");
- readpatrepplus(&rep);
- pset_pat_rep_plus(ws, index, &rep);
- #endif
- } /* do_psetpatrepplus */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetlinecolr()
- {
- #ifdef SUN
- Pgcolr colour;
-
- readgcolr(&colour, "line colour");
- pset_line_colr(&colour);
- #endif
- } /* do_psetlinecolr */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetlinerepplus()
- {
- #ifdef SUN
- Pint ws, index;
- Pline_bundle_plus rep;
-
- ws = readinteger("workstation identifier ? ");
- index = readinteger("line index ? ");
- readlinebundleplus(&rep);
- pset_line_rep_plus(ws, index, &rep);
- #endif
- } /* do_psetlinerepplus */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetlineshadmeth()
- {
- #ifdef SUN
- pset_line_shad_meth(readinteger("line shading method ? "));
- #endif
- } /* do_psetlineshadmeth */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetmarkercolr()
- {
- #ifdef SUN
- Pgcolr colour;
-
- readgcolr(&colour, "line colour");
- pset_marker_colr(&colour);
- #endif
- } /* do_psetmarkercolr */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetmarkerrepplus()
- {
- #ifdef SUN
- Pint ws, index;
- Pmarker_bundle_plus rep;
-
- ws = readinteger("workstation identifier ? ");
- index = readinteger("marker index ? ");
- readmarkerbundleplus(&rep);
- pset_marker_rep_plus(ws, index, &rep);
- #endif
- } /* do_psetmarkerrepplus */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetreflind()
- {
- #ifdef SUN
- phintererror(1, (char *)NULL, INFORM);
- #endif
- } /* do_psetreflind */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetreflmodel()
- {
- #ifdef SUN
- pset_refl_eqn(readinteger("reflectance model ? "));
- #endif
- } /* do_psetreflmodel */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetreflprops()
- {
- #ifdef SUN
- Prefl_props props;
-
- readreflprops(&props, "reflectance properties");
- pset_refl_props(&props);
- #endif
- } /* do_psetreflprops */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetreflrep()
- {
- #ifdef SUN
- phintererror(1, (char *)NULL, INFORM);
- #endif
- } /* do_psetreflrep */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetrenderingcolrmodel()
- {
- #ifdef SUN
- pset_rendering_colr_model(readinteger("rendering colour model ? "));
- #endif
- } /* do_psetrenderingcolrmodel */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psetsurfapprox()
- {
- #ifdef SUN
- Pint type;
- Pfloat uvalue, vvalue;
-
- type = readinteger("surface approx type ? ");
- uvalue = readreal("surface approx value for u dimension ? ");
- vvalue = readreal("surface approx value for v dimension ? ");
- pset_surf_approx(type, uvalue, vvalue);
- #endif
- } /* do_psetsurfapprox */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psettextcolr()
- {
- #ifdef SUN
- Pgcolr colour;
-
- readgcolr(&colour, "text colour");
- pset_text_colr(&colour);
- #endif
- } /* do_psettextcolr */
-
- /*------------------------------------------------------------------------*/
-
- static void do_psettextrepplus()
- {
- #ifdef SUN
- Pint ws, index;
- Ptext_bundle_plus rep;
-
- ws = readinteger("workstation identifier ? ");
- index = readinteger("text index ? ");
- readtextbundleplus(&rep);
- pset_text_rep_plus(ws, index, &rep);
- #endif
- } /* do_psettextrepplus */
-
- /*------------------------------------------------------------------------*/
-
- static void do_ptrisetdata()
- {
- #ifdef SUN
- phintererror(1, (char *)NULL, INFORM);
- #endif
- } /* do_ptrisetdata */
-
- /*------------------------------------------------------------------------*/
-
- static void do_ptriset3data()
- {
- #ifdef SUN
- phintererror(1, (char *)NULL, INFORM);
- #endif
- } /* do_ptriset3data */
-
- /*------------------------------------------------------------------------*/
-
- static void do_ptristripdata()
- {
- #ifdef SUN
- phintererror(1, (char *)NULL, INFORM);
- #endif
- } /* do_ptristripdata */
-
- /*------------------------------------------------------------------------*/
-
- static void do_ptristrip3dat()
- {
- #ifdef SUN
- Pint fflag, vflag, colour_model, nv;
- Pfacet_data_arr3 fdata;
- Pfacet_vdata_arr3 vdata;
-
- fflag = readinteger("facet data flag ? ");
- vflag = readinteger("vertex data flag ? ");
- colour_model = readinteger("colour model ? ");
- nv = readinteger("number of vertices ? ");
- readfacetdataarr3(fflag, colour_model, nv, &fdata);
- readfacetvdataarr3(vflag, colour_model, nv, &vdata);
- ptri_strip3_data(fflag, vflag, colour_model, nv, &fdata, &vdata);
- switch (fflag)
- {
- case PFACET_NONE:
- break;
-
- case PFACET_COLOUR:
- free(fdata.colrs);
- break;
-
- case PFACET_NORMAL:
- free(fdata.norms);
- break;
-
- case PFACET_COLOUR_NORMAL:
- free(fdata.conorms);
- break;
- }
- switch (vflag)
- {
- case PVERT_COORD:
- free(vdata.points);
- break;
-
- case PVERT_COORD_COLOUR:
- free(vdata.ptcolrs);
- break;
-
- case PVERT_COORD_NORMAL:
- free(vdata.ptnorms);
- break;
-
- case PVERT_COORD_COLOUR_NORMAL:
- free(vdata.ptconorms);
- break;
- }
- #endif
- } /* do_ptristrip3dat */
-
- /*------------------------------------------------------------------------*/
-